package com.ctl.szmd.szmd.feature_wm.data.api

import com.ctl.szmd.szmd.feature_wm.data.bean.WmDataBean
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*

/**
 * created by : chentl
 * Date: 2020/07/22
 */
interface WmService {

    companion object {
        const val BASE_URL = "http://mudu.zaznkj.com"
    }

    @GET
    @Streaming
    fun downloadFile(@Url url: String): Call<ResponseBody>

    //登录
    @FormUrlEncoded
    @POST("$BASE_URL/api/Login/Login")
    suspend fun loginInfo(@FieldMap map: MutableMap<String, Any>): WmDataBean

    //巾帼心向党
    @FormUrlEncoded
    @POST("$BASE_URL/api/InfoFaceParty/InfoCommonList")
    suspend fun infoFacePartyListData(
        @Field("CurrentPage") currentPage: Int,
        @Field("PageSize") pageSize: Int
    ): WmDataBean

    //妇联头条
    @FormUrlEncoded
    @POST("$BASE_URL/api/InfoWomenHeadline/InfoCommonList")
    suspend fun infoWomenHeadlineListData(
        @Field("CurrentPage") currentPage: Int,
        @Field("PageSize") pageSize: Int
    ): WmDataBean

    //网页新闻访问记录
    @FormUrlEncoded
    @POST("$BASE_URL/api/InfoVisitCount/InfoVisitCountStatistics")
    suspend fun infoVisitCountStatistics(
        @Field("VisitTypeNum") visitTypeNum: Int,
        @Field("InfoId") infoId: String
    )

    //网页新闻附件列表
    @FormUrlEncoded
    @POST("$BASE_URL{path}")
    suspend fun infoWebViewAttachmentList(
        @Path("path", encoded = true) path: String,
        @FieldMap map: MutableMap<String, String>
    ): WmDataBean

    //基层风采
    @FormUrlEncoded
    @POST("$BASE_URL/api/InfoBasicStyle/InfoCommonList")
    suspend fun infoBasicStyleList(
        @Field("CurrentPage") currentPage: Int,
        @Field("PageSize") pageSize: Int
    ): WmDataBean

    //小额贷款
    @FormUrlEncoded
    @POST("$BASE_URL/api/InfoPettyLoan/InfoCommonList")
    suspend fun infoPettyLoanList(
        @Field("CurrentPage") currentPage: Int,
        @Field("PageSize") pageSize: Int
    ): WmDataBean

    //妇联简介
    @FormUrlEncoded
    @POST("$BASE_URL/api/FulianAppIndexIntro/IntroContentDetail")
    suspend fun fulianAppIndexIntro(
        @Field("ContentId") contentId: String
    ): WmDataBean

    //下属组织
    @FormUrlEncoded
    @POST("$BASE_URL/api/FulianAppIndexSubOrg/SubOrgContentInfoList")
    suspend fun fulianAppIndexSubOrgContentInfoList(
        @Field("CurrentPage") currentPage: Int,
        @Field("PageSize") pageSize: Int
    ): WmDataBean

    @FormUrlEncoded
    @POST("$BASE_URL/api/FulianAppIndexSubOrg/SubOrgContentInfoList")
    suspend fun fulianAppIndexSubOrgContentInfoList(
        @Field("CurrentPage") currentPage: Int,
        @Field("PageSize") pageSize: Int,
        @Field("DepId") mDepId: String
    ): WmDataBean

    @POST("$BASE_URL/api/FulianMyCenterMyInfo/FulianMyInfo")
    suspend fun fulianMyCenterMyInfo(): WmDataBean

}